package org.zlb.manager.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/10 12:30
 */
@Entity
@Table(name = "org_dept_rule", schema = "admin", catalog = "")
@IdClass(OrgDeptRulePK.class)
public class OrgDeptRule {
    private long deptId;
    private String menuCode;

    @Id
    @Column(name = "DEPT_ID")
    public long getDeptId() {
        return deptId;
    }

    public void setDeptId(long deptId) {
        this.deptId = deptId;
    }

    @Id
    @Column(name = "MENU_CODE")
    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrgDeptRule that = (OrgDeptRule) o;
        return deptId == that.deptId &&
                Objects.equals(menuCode, that.menuCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptId, menuCode);
    }
}
